package com.shi.consultant.controller;

import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ChatController {
    @Autowired
    private OpenAiChatModel openAiChatModel;
    @RequestMapping("/chat")
    public String chat(@RequestParam(value = "message") String message){
        String result = openAiChatModel.chat(message);
        return result;
    }
}
